/*-------------------------------------------------------------------
 * include
 *-------------------------------------------------------------------*/
#include "app_sock.h"

/*-------------------------------------------------------------------
 * class
 *-------------------------------------------------------------------*/
int SocketApp::get_fd()
{
    return fd_;
}

void SocketApp::set_fd(int fd)
{
    fd_ = fd;
}

/*-------------------------------------------------------------------
 * class
 *-------------------------------------------------------------------*/
char* SocketApp::get_buff_data(BUFF_TYPE type)
{
    return BUFF_R == type ? buff_read_ : buff_write_;
}

/*-------------------------------------------------------------------
 * set_buff_size
 *-------------------------------------------------------------------*/
void SocketApp::set_buff_size(BUFF_TYPE type, int size)
{
    if (BUFF_R == type)
    {
        read_size_ = size;
    }
    else
    {
        write_size_ = size;
    }
}

/*-------------------------------------------------------------------
 * class
 *-------------------------------------------------------------------*/
void SocketAppHttp::read()
{
    read_size_ = 0;
    printf("fd:%d,read:%s\n", fd_, buff_read_);
}

/*-------------------------------------------------------------------
 * class
 *-------------------------------------------------------------------*/
void SocketAppHttp::write()
{

}